<template>
  <div class="list-item" @click="linkDetail">
    <img class="icon" src="@/assets/common/text-icon.png" />
    <div class="item-content">
      <div class="title-wrap">
        <div class="title">{{ content.period || content.year + "年度" }}</div>
        <div class="status-text">{{ levelList[content.judgeLevel] }}</div>
      </div>
      <div class="status-wrap">
        <div class="status during" v-if="$route.query.type != 'year'">{{ content.approveStatusName }}</div>
        <div v-else></div>
        <div class="text">评定等次</div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    content: {
      type: Object,
      default: () => {}
    },
    levelList: {
      type: Object,
      default: () => {}
    }
  },
  methods: {
    linkDetail() {
      this.$router.push({
        path: "/appraisalResults/detail",
        query: {
          id: this.content.id,
          is_year: this.$route.query.type == "year" ? 1 : 0
        }
      });
    }
  }
};
</script>

<style scoped lang="scss">
.list-item {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  background: #fff;
  margin-bottom: 12px;
  border-radius: 8px;
  img {
    width: 30px;
    margin-right: 18px;
  }
  .item-content {
    flex: 1;
    > div {
      display: flex;
      align-items: center;
      justify-content: space-between;
      line-height: 17px;
      font-size: 12px;
      color: #a3a7ad;
      .title {
        font-size: 14px;
        color: #333333;
        line-height: 20px;
      }
      .status-text {
        font-size: 15px;
        color: #f60e36;
        font-weight: 600;
      }
      .status {
        margin-top: 3px;
        &.during {
          color: #15dd81;
        }
      }
    }
  }
}
</style>
